﻿/************************************************************************************
 *      Copyright (C) 2015 yuwei,All Rights Reserved
 *      File:
 *                Demo.cs
 *      Description:
 *            线程相关演示类
 *      Author:
 *                Yangxianwen
 *                
 *                
 *      Finish DateTime:
 *                2017年07月25日
 *      History:
 ***********************************************************************************/

using System;

namespace ThreadDemo
{
    public class Demo
    {
        private static Demo _demo = null;

        /// <summary>
        /// 构造函数
        /// </summary>
        private Demo()
        {
            Console.WriteLine("构造了{0}", GetType().Name);
        }

        /// <summary>
        /// 获取该类的唯一实例
        /// </summary>
        /// <returns>该类的唯一实例</returns>
        public static Demo GetInstance()
        {
            if (_demo == null)
                _demo = new Demo();
            return _demo;
        }
    }
}
